extends MonsterAction

var shield = 10

func perform_action() -> void:
	if not monster:
		return
	
	var tween := create_tween().set_trans(Tween.TRANS_QUINT)

	tween.tween_callback(Shake.state_play.bind(monster, StateBar.STATE.SHIELD, Globals.get_final_shield(monster.state, shield)))
	tween.tween_interval(0.5)
	
	tween.finished.connect(
		func():
			monster.state.shield += Globals.get_final_shield(monster.state, shield)
			Events.monster_action_completed.emit(monster)
	)


func init_intent_value():
	var intent_attack = ALL_INTENT_TRES_DICT.intent_dict[Intent.INTENT.SHIELD].duplicate()
	intent_attack.value = Globals.get_final_shield(monster.state, shield);
	self.intent = intent_attack;
